package com.woniu40.petai_manager.mapper;

import com.woniu40.petai_manager.entity.Comment;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CommentMapper {
    int deleteByPrimaryKey(Integer commentId);

    int insert(Comment record);

    Comment selectByPrimaryKey(Integer commentId);

    List<Comment> selectAll();

    int updateByPrimaryKey(Comment record);

    //删除评论
    @Delete("delete from t_comment where comment_id=#{value}")
    int deleteCom(Integer commentId);
    //根据id被举报获得评论
    @Select("select * from t_comment where comment_id=#{value}")
    Comment selectByComId(Integer commentId);
}